{% extends "template.html" %}
{% block title %}找回密码{% endblock %}
{% block main %}
    <div id="main">
        <!-- 上传表单-->
        <div class="upload">
            <p>密码找回</p>
            <hr/>
            <form id="myform">
                <span>
                    <label>找回方式：</label>
                    <select class="upt" name="type">
                        <option selected="selected" value="email">邮件找回</option>
						<option value="tel">电话找回</option>
                    </select>
                </span>
                <span>
                    <label>输入账号：</label>
                    <input class="upt" type="text" name="tel" value=""/>
                </span>
                <span>
                    <label>输入邮箱/电话：</label>
                    <input class="upt" type="text" name="certificate" value=""/>
                </span>
                <span><label class="btn"><input id="find_btn" type="button" value="确认找回"/></label></span>
            </form>
        </div>

    </div>
{% endblock %}
{% block script %}
    <script>
        $(function () {
            $("#find_btn").click(function () {

                $.ajax({
                    url: '/user/find_password',
                    method: 'POST',
                    data: $("#myform").serialize(),
                    dataType: 'json',
                    success: function (data) {
                        alert(data.msg)
                    }
                })
                // $(this).parents("form").submit()
            })
        })
    </script>
{% endblock %}